/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Servlet.index;

import Model.Purchase.PurchaseMaterielListView;
import RssEasy.Core.HttpRequestHelper;
import RssEasy.Core.SignVerifyRequestHelper;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author admin
 */
@WebServlet(name = "index_change", urlPatterns = {"/index/change"})
public class change extends SignVerifyRequestHelper {

    protected HttpRequestHelper request(HttpServletRequest request, HttpServletResponse response) {
        super.request(request, response);
        try {
            PurchaseMaterielListView pmv = new PurchaseMaterielListView(pageContext);
            int pag =Integer.parseInt(this.get("pag"));
            pmv.curpage =pag;
            pmv.select("typid,state,projectid,name,materielname,enddt").where("typid=1 and state=1 or state=2").get_page_desc("projectid");
            out.print(pmv.toKeyValue());
        } catch (Exception e) {
        }
        return this;

    }

}
